package com.digitalchina.lxnsy.viewholder;

import android.app.Activity;
import android.view.View;
import android.view.ViewGroup;
import android.widget.Button;
import android.widget.TextView;

import com.digitalchina.lxnsy.R;
import com.digitalchina.lxnsy.activity.management.SetPermissionActivity;
import com.digitalchina.lxnsy.entity.MemberListVO;
import com.digitalchina.lxnsy.toolkit.GotoUtil;
import com.jude.easyrecyclerview.adapter.BaseViewHolder;

/**
 * ================================================
 * 项目名称：BigData
 * 类描述：
 * 包名：com.digitalchina.bigdata.viewholder
 * 创建人：郑皓
 * 创建时间：2018/1/13 14:45:58
 * 修改备注：
 * ================================================
 */

public class MemberPermissionListHolder extends BaseViewHolder<MemberListVO> {

    private TextView tvName;//姓名
    private TextView tvTel;//电话
    private Button btSet;


    public MemberPermissionListHolder(ViewGroup parent) {
        super(parent, R.layout.item_member_permission);

        tvName = $(R.id.tv_name);
        tvTel = $(R.id.tv_tel);
        btSet = $(R.id.bt_set);
    }

    @Override
    public void setData(final MemberListVO data) {
        super.setData(data);

        tvName.setText(data.getUserName());
        tvTel.setText(data.getMobilePhone());

        btSet.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                GotoUtil.gotoActivity((Activity) getContext(), SetPermissionActivity.class, "MemberListVO", data);
            }
        });
    }

}
